package com.oa.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.oa.bean.ContrUser;
import com.oa.bean.Contract;
import com.oa.bean.Section;
import com.oa.bean.User;
import com.oa.dao.CMDao;
import com.oa.service.CMService;

@Service
public class CMServiceImpl implements CMService {

	@Autowired
	private CMDao cMDao;
	
	@Override
	public List<Section> findSec() {
		// TODO Auto-generated method stub
		List<Section> sections=cMDao.findSec();
		return sections;
	}

	@Override
	public List<User> findUser(int udepartment_id) {
		// TODO Auto-generated method stub
		List<User> users=cMDao.findUser(udepartment_id);
		return users;
	}

	@Override
	public int addCon(Contract contract) {
		// TODO Auto-generated method stub
		int result=cMDao.addCon(contract);
		return result;
	}

	@Override
	public List<ContrUser> findCon(Contract contract) {
		// TODO Auto-generated method stub
		List<ContrUser> contrUsers=cMDao.findCon(contract);
		return contrUsers;
	}

	@Override
	public Contract dec(String uname) {
		// TODO Auto-generated method stub
		Contract contract=cMDao.dec(uname);
		return contract;
	}

	@Override
	public Contract findContr(String con_num) {
		// TODO Auto-generated method stub
		Contract contract=cMDao.findContr(con_num);
		return contract;
	}

	@Override
	public ContrUser findCon1(int con_id) {
		// TODO Auto-generated method stub
		ContrUser contrUser=cMDao.findCon1(con_id);
		return contrUser;
	}

	@Override
	public int updateCon(Contract contract) {
		// TODO Auto-generated method stub
		int result=cMDao.updateCon(contract);
		return result;
	}

}
